package org.hive.vmware.client.model;

import java.io.Serializable;

import com.extjs.gxt.ui.client.data.BaseTreeModel;

public class VmCenterServerTreeFolder extends BaseTreeModel implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private static int ID = 0;
	private boolean isLoadError = false;
	
	
	public void setLoadError(boolean loadError) {
		this.isLoadError = loadError;
	}

	public boolean isLoadError() {
		return this.isLoadError;
	}
	
	public VmCenterServerTreeFolder() {
		set("id", ID++);
	}

	public VmCenterServerTreeFolder(String name) {
		set("id", ID++);
		set("name", name);
	}

	public VmCenterServerTreeFolder(String name, BaseTreeModel[] children) {
		this(name);
		for (int i = 0; i < children.length; i++) {
			add(children[i]);
		}
	}

	public Integer getId() {
		return (Integer) get("id");
	}

	public String getName() {
		return (String) get("name");
	}

	public String toString() {
		return getName();
	}

}
